var config = require('./config.js');
const imgurl = "http://wt.wanpinhui.tech/uploads/"; //图片公共路径
//注册
var registerAccount = function(e){
	return config.postRequest("api/index/register",e);
};

//登录
var loginApply = function(e){
	return config.postRequest("api/index/login",e);
};

//获取用户信息
var getMemberInfo = function(e){
	return config.getRequest("api/user/index",e);
};

//图片上传 
var uploadImg = function(e){
	return config.postRequest("api/uploader",e);
};

//获取首页轮播
var getBanner = function(e){
	return config.getRequest("api/index/banner",e);
};

//获取首页文章
var getNewsList = function(e){
	return config.getRequest("api/index/getNewsList",e);
};

//文章详情
var getDetail = function(e){
	return config.getRequest("api/index/getDetail",e);
};

//点击模块获取列表
var getTabList = function(e){
 	return config.getRequest("api/index/getTabList",e);
 };
 
//获取住宿下的酒店房间
 var getRoomsList = function(e){
 	return config.getRequest("api/index/getRoomsList",e);
 };
 
 //获取AR地址
  var getSetting = function(e){
  	return config.getRequest("api/index/getSetting",e);
  };
 
 
 /** 
  * 
  * 有奖竞猜 
  * 
  * **/
  
  //检测是否可以答题
  var checkAnswerLog = function(e){
  	return config.getRequest("api/user/checkAnswerLog",e);
  };
  
 //根据类型获取题目
 var getTopics = function(e){
 	return config.getRequest("api/user/getTopics",e);
 };
 
 //获取题目类型
 var getAnsWerType = function(e){
 	return config.getRequest("api/user/getAnsWerType",e);
 };
 
 //提交答题结果
 var answerResults = function(e){
 	return config.postRequest("api/user/answerResults",e);
 };
 //获取答题结果
 var getAnswerLogs = function(e){
 	return config.getRequest("api/user/getAnswerLogs",e);
 };
 //获取中奖记录详情
 var getAnswerLogDetail = function(e){
 	return config.getRequest("api/user/getAnswerLogDetail",e);
 };
 
 
module.exports = {
	imgurl,
	registerAccount,
	loginApply,
	getMemberInfo,
	uploadImg,
	getBanner,
	getNewsList,
	getDetail,
	getTabList,
	getRoomsList,
	getSetting,
	checkAnswerLog,
	getTopics,
	getAnsWerType,
	answerResults,
	getAnswerLogs,
	getAnswerLogDetail
}
